package langchain4j.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import langchain4j.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Insert("INSERT INTO user (username, password, real_name, gender, phone, id_card, register_time) " +
            "VALUES (#{username}, #{password}, #{realName}, #{gender}, #{phone}, #{idCard}, NOW())")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void register(User user);
}
